Skip to content

Conversation

@kozikkamil
Copy link
Contributor

@kozikkamil kozikkamil commented Feb 22, 2023

Adds the new ModelSlice entity and get method

return PaginatedCollection(
client=self.client,
query=query_str,
params={'id': self.uid},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to gql above, $first is required, but I do not see it in the params. Is it ok?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prob handled in PaginatedCollection?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

query=query_str,
params={'id': self.uid},
dereferencing=['getDataRowIdsBySavedQuery', 'nodes'],
obj_class=lambda _, data_row_id: data_row_id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not following here... according to PaginatedCollection documentation, obj_class is a class of an object...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That documentation is 4 years old, I think it's outdated. I was actually just copying the code from CatalogSlice here 😅

@dubininsergey
Copy link
Contributor

The change looks good, @kozikkamil can we add a basic fuse test for the method?
I know we can't do e2e test because it's not possible to create Model Slice via SDK, however we could mock HTTP response and make sure SDK behaves in expected way given the expected API response

@kozikkamil
Copy link
Contributor Author

The change looks good, @kozikkamil can we add a basic fuse test for the method? I know we can't do e2e test because it's not possible to create Model Slice via SDK, however we could mock HTTP response and make sure SDK behaves in expected way given the expected API response

It won't actually be giving any value though. We'll be effectively unit testing PaginatedCollection class, which I am sure has enough coverage already from the e2e tests. It seems like it's not worth to spend the time right now to set that up. ModelSlice has basically no logic in itself

@dubininsergey
Copy link
Contributor

The change looks good, @kozikkamil can we add a basic fuse test for the method? I know we can't do e2e test because it's not possible to create Model Slice via SDK, however we could mock HTTP response and make sure SDK behaves in expected way given the expected API response

It won't actually be giving any value though. We'll be effectively unit testing PaginatedCollection class, which I am sure has enough coverage already from the e2e tests. It seems like it's not worth to spend the time right now to set that up. ModelSlice has basically no logic in itself

IMO we should have a fuse test that would catch for example the case where the name of public method has been changed accidentally, or it has been removed at all. If we have something mentioned in SDK docs we should be sure that it's in the code too.

Not going to block this though

@kozikkamil kozikkamil merged commit ba106df into develop Mar 1, 2023
@kozikkamil kozikkamil deleted the kozikkam/AL-4886 branch March 1, 2023 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants